﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Commnications
{
    public interface IDataMessage
    {
        /// <summary>
        /// 头长度
        /// </summary>
        int HeadLength { get; }
        /// <summary>
        /// 获取消息长度
        /// </summary>
        int GetMessageLength(byte[] data);
        /// <summary>
        /// 是否对应请求消息
        /// </summary>
        /// <param name="send"></param>
        /// <param name="receive"></param>
        /// <returns></returns>
        bool CheckCompleteMessage(byte[] send, byte[] receive);
        /// <summary>
        /// 检查消息头是否有效
        /// </summary>
        /// <param name="send"></param>
        /// <param name="receive"></param>
        /// <returns></returns>
        bool CheckHeadValid(byte[] send, byte[] receive);
    }
}
